$(document)
		.ready(
				function() {
					var id = getQueryString('id');
					var resultType = getQueryString('resultType');
					console.log(id);
					console.log(resultType)
					$
							.ajax({
								type : "post",
								url : "userList",
								async : true,
								data : {
									"id" : id,
									"resultType" : resultType,
								},
								dataType : 'json',
								success : function(data) {
									console.log(data)
									var articlePath = 'myAssets//img//article//';// 文章文件路径
									var facePath = 'myAssets//img//face//';// 头像文件路径
									var resultType = data.resultType;
									var user = data.user;
									if (resultType == "userFollows") {
										$("#title-name").html(
												'全部关注 ' + user.follows.length);
										if (user.follows.length != 0) {
											var followslist = user.follows;
											for (var i = 0; i < followslist.length; i++) {
												var user = followslist[i];// user
												var name = user.name;// 用户名
												var id = user.id;// 用户ID
												var synopsis = user.synopsis;// 个性签名
												var myFileName = user.myFile.name;// 头像文件名
												var follows = user.follows;// 关注集合
												var fans = user.fans;// 粉丝集合
												var articles = user.articles;// 发布集合
												$("#list-info")
														.append(
																'<a href="heUser?id='
																		+ id
																		+ '"> <div class="pet_list_one_info">  <div class="pet_list_one_info_l"> <div class="pet_list_one_info_ico"><img src="'
																		+ facePath
																		+ myFileName
																		+ '" alt=""></div><div class="pet_list_one_info_name" style="font-weight: bold;">'
																		+ name
																		+ '</div>      <div class="pet_list_one_info_name" style="color: #ff5656;">关注 '
																		+ follows.length
																		+ '</div> <div class="pet_list_one_info_name" style="color:#3bb4f2;">粉丝 '
																		+ fans.length
																		+ '</div> <div class="pet_list_one_info_name"style="color:#FFC107;">发布 '
																		+ articles.length
																		+ '</div>     </div>      </div>   <div class="am-list-item-text pet_list_two_text">'
																		+ synopsis
																		+ '</div> </a><hr data-am-widget="divider" style="" class="am-divider am-divider-default" />')
											}
										}
									}
									if (resultType == "userFans") {
										$("#title-name").html(
												'全部粉丝 ' + user.fans.length);
										if (user.fans.length != 0) {
											var fanslist = user.fans;
											for (var i = 0; i < fanslist.length; i++) {
												var user = fanslist[i];// user
												var name = user.name;// 用户名
												var id = user.id;// 用户ID
												var synopsis = user.synopsis;// 个性签名
												var myFileName = user.myFile.name;// 头像文件名
												var follows = user.follows;// 关注集合
												var fans = user.fans;// 粉丝集合
												var articles = user.articles;// 发布集合
												$("#list-info")
														.append(
																'<a href="heUser?id='
																		+ id
																		+ '"> <div class="pet_list_one_info">  <div class="pet_list_one_info_l"> <div class="pet_list_one_info_ico"><img src="'
																		+ facePath
																		+ myFileName
																		+ '" alt=""></div><div class="pet_list_one_info_name" style="font-weight: bold;">'
																		+ name
																		+ '</div>      <div class="pet_list_one_info_name" style="color: #ff5656;">关注 '
																		+ follows.length
																		+ '</div> <div class="pet_list_one_info_name" style="color:#3bb4f2;">粉丝 '
																		+ fans.length
																		+ '</div> <div class="pet_list_one_info_name"style="color:#FFC107;">发布 '
																		+ articles.length
																		+ '</div>     </div>      </div>   <div class="am-list-item-text pet_list_two_text">'
																		+ synopsis
																		+ '</div> </a><hr data-am-widget="divider" style="" class="am-divider am-divider-default" />')
											}
										}
									}

								},
								error : function() {
								}
							});

				})

// 获取url中的参数
function getQueryString(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); // 匹配目标参数
	var result = window.location.search.substr(1).match(reg); // 对querystring匹配目标参数
	if (result != null) {
		return decodeURIComponent(result[2]);
	} else {
		return null;
	}
}
